<?php 
//将配置文件包含进来
require('./includes/config.inc.php');
//选择要显示的页面
if(isset($_GET['p'])){

	$p=$_GET['p'];
}elseif(isset($_POST['p'])){

	$p=$_POST['p'];
}else{

	$p=null;
}
//决定显示的界面
switch($p){

	case 'about':
	$page='about.inc.php';
	$page_title='About This Site';
	break;
	case 'contact':
	$page='contact.inc.php';
	$page_title='Contact Us';
	break;
	case 'search':
	$page='search.inc.php';
	$page_title='Search Results';
	break;
	default:
	$page='main.inc.php';
	$page_title='Site Home Page';
	break;

}
//确认模块是否存在
if(!file_exists('./modules/'.$page)){

	$page='main.inc.php';
	$page_title='Site Home Page';
}
//把header.html 包含进来
include('./includes/header.html');
//把模块包含进来
include('./modules/'.$page);
//将footer.html 包含进来
include('./includes/footer.html');


 ?>